home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / dskut / rfileu10.zip / CAT.DOC next >
Text File  |  1993-05-06  |  6KB  |  149 lines

  1.  
  2.  
  3.                              #####                 
  4.                             #     #    ##     #####
  5.                             #         #  #      #  
  6.                             #        #    #     #  
  7.                             #        ######     #  
  8.                             #     #  #    #     #  
  9.                              #####   #    #     #  
  10.  
  11.  
  12.  
  13.  
  14. You can get part of the following documentation by invoking the program with
  15. the switches -v, -h, or -H . See README.TXT for more information.
  16.  
  17. -----------------------------------   -v   ------------------------------------
  18. CAT v1.0 -- Copy files to stdout
  19. Copr (c) 1992,1993 Richard Breuer. CAT is freeware. No warranties.
  20.  
  21. This is CAT/2 v1.0 - renamed to CAT (from RUTILS 4).
  22.  
  23. Author: Richard Breuer
  24.         Brunssumstrasse 6
  25.         5100 Aachen
  26.         (after Jul 1, 1993: 52074 Aachen)
  27.         Germany
  28.         Europe
  29.  
  30. Phone:  +49/241/85605
  31. Fax:    +49/241/8021329
  32.  
  33. Email:  ricki@pool.informatik.rwth-aachen.de (Preferred!)
  34.  
  35. -----------------------------------   -h   ------------------------------------
  36. CAT v1.0 -- Copy files to stdout
  37. Copr (c) 1992,1993 Richard Breuer. CAT is freeware. No warranties.
  38.  
  39. Usage:
  40.    CAT [-bcCehHnstv*] infile.. [{>|>>} outfile]
  41.  
  42. Options (-n overrides -b; -c excludes -bCent):
  43.    -b  Number the lines as -n, but omit the line numbers from blank lines
  44.    -c  Binary copy mode. CAT creates an exact copy of the input files
  45.    -C  Text copy mode. CAT treats input and output files as text files
  46.    -e  Mark each line end with a $
  47.    -h  Display this help screen
  48.    -H  Display another help screen with notes and examples
  49.    -n  Precede each line output with its line number
  50.    -s  Suppress warnings about files which cannot be opened
  51.    -t  Display non-printable characters including <TAB>
  52.    -v  Display version info and information about the author
  53.    -*  Display internal information (for debugging purposes)
  54.  
  55. -----------------------------------   -H   ------------------------------------
  56. CAT v1.0 -- Copy files to stdout
  57. Copr (c) 1992,1993 Richard Breuer. CAT is freeware. No warranties.
  58.  
  59. Notes:
  60.    CAT reads from stdin if a filename is -. The output is always directed
  61.    to stdout. The errorlevel is set to 1 if help has been displayed. It is set
  62.    to 255 in case of an error and 0 on normal completion. Output resulting from
  63.    multiple input files is appended to stdout. The processing order for wild-
  64.    cards depends on the order of the directory entries. CAT does work for
  65.    binary files. In text mode lines longer than 255 characters are truncated.
  66.    CAT uses binary mode whenever the output is redirected to a file, other-
  67.    wise it uses text mode. You may override this behaviour with -C and -c.
  68.  
  69. Examples:
  70.    CAT *.TXT -
  71.       Process all *.TXT files in the current directory and append them to
  72.       stdout. The order is the one DOS's dir tells you. After that read further
  73.       input from the command line until EOF = Ctrl/Z is detected.
  74.    DIR | CAT -n
  75.       Displays the directory with line numbers.
  76.    CAT COMMAND.COM > A:COMMAND.COM
  77.       A rather unconventional way to copy COMMAND.COM to drive A: :-)
  78.  
  79. -------------------------------------------------------------------------------
  80. Additional information:
  81.    CAT is a re-implementation of the Unix command with the same name. There are
  82.    some differences, though.
  83.  
  84.    CAT knows two modes of operation: text and binary mode. Text mode is suitable
  85.    for ASCII files, in which lines are separated with <CR><LF> and whose line
  86.    length is shorter than 256 characters. Binary mode is suitable for arbitrary
  87.    files. The reason why CAT distinguishes between them is that CAT cannot
  88.    block-write on the console.
  89.  
  90.    I tried to make the way CAT switches between text and binary mode as clear
  91.    as possible. The easiest explanation of how CAT behaves is: As you expect it
  92.    to :-), or at least I hope so. The detailed description is this:
  93.  
  94.         - if -c is specified, binary mode is used, otherwise
  95.         - if at least one of -b, -C, -e, -n, or -t is specified, text mode is
  96.           used (because these options only make sense for text files), otherwise
  97.         - if the output is redirected to a file, binary mode is used, otherwise
  98.           text mode is used
  99.  
  100.    Note that -c excludes -b, -C, -e, -n, and -t.
  101.  
  102. Examples (imagine <FF> to be CHR(12)):
  103.    CAT FOO.DAT            { normal (text) CAT }
  104.      >    This is an example<
  105.      >text with TABs and<
  106.      ><FF>form feed.<
  107.      ><
  108.      >^^^ empty line<
  109.  
  110.    CAT -n FOO.DAT        { (text) CAT with line numbers }
  111.      >     1      This is an example<
  112.      >     2  text with TABs and<
  113.      >     3  <FF>form feed.<
  114.      >     4<
  115.      >     5  ^^^ empty line<
  116.  
  117.    CAT -b FOO.DAT        { as CAT -n, omitting empty lines }
  118.      >     1      This is an example<
  119.      >     2  text with TABs and<
  120.      >     3  <FF>form feed.<
  121.      ><
  122.      >     5  ^^^ empty line<
  123.  
  124.    CAT -e FOO.DAT        { (text) CAT, marking line ends with $ }
  125.      >    This is an example$<
  126.      >text with TABs and$<
  127.      ><FF>form feed.$<
  128.      >$<
  129.      >^^^ empty line$<
  130.  
  131.    CAT -t FOO.DAT        { (text) CAT, with printable representations
  132.                      of non-printable characters }
  133.      >^IThis is an example<
  134.      >text with TABs and<
  135.      >^Lform feed.<
  136.      ><
  137.      >^^^ empty line<
  138.  
  139.   Now some examples for binary CAT. The result cannot be included here, because
  140.   the files are assumed to be not readable:
  141.  
  142.    CAT -c FOO.DAT        { (binary) CAT to the console. This will
  143.                      likely produce an error message }
  144.  
  145.    CAT \COMMAND.COM > FOO.COM    { (binary) CAT, copies COMMAND.COM to FOO.COM,
  146.                      which is an exact copy of COMMAND.COM }
  147.  
  148.    CAT A B C > D        { (binary) CAT, appending A+B+C to D }
  149.